/**
 * <copyright>
 * </copyright>
 *

 */
package org.dslintegration.kM3.impl;

import org.dslintegration.kM3.Attribute;
import org.dslintegration.kM3.Classifier;
import org.dslintegration.kM3.Datatype;
import org.dslintegration.kM3.Enumeration;
import org.dslintegration.kM3.Feature;
import org.dslintegration.kM3.KM3Class;
import org.dslintegration.kM3.KM3Factory;
import org.dslintegration.kM3.KM3Package;
import org.dslintegration.kM3.Literal;
import org.dslintegration.kM3.Metamodel;
import org.dslintegration.kM3.Multiplicity;
import org.dslintegration.kM3.Reference;
import org.dslintegration.kM3.TypeRef;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class KM3FactoryImpl extends EFactoryImpl implements KM3Factory
{
  /**
   * Creates the default factory implementation.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public static KM3Factory init()
  {
    try
    {
      KM3Factory theKM3Factory = (KM3Factory)EPackage.Registry.INSTANCE.getEFactory("http://www.dslintegration.org/KM3"); 
      if (theKM3Factory != null)
      {
        return theKM3Factory;
      }
    }
    catch (Exception exception)
    {
      EcorePlugin.INSTANCE.log(exception);
    }
    return new KM3FactoryImpl();
  }

  /**
   * Creates an instance of the factory.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public KM3FactoryImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public EObject create(EClass eClass)
  {
    switch (eClass.getClassifierID())
    {
      case KM3Package.METAMODEL: return createMetamodel();
      case KM3Package.PACKAGE: return createPackage();
      case KM3Package.CLASSIFIER: return createClassifier();
      case KM3Package.KM3_CLASS: return createKM3Class();
      case KM3Package.FEATURE: return createFeature();
      case KM3Package.ATTRIBUTE: return createAttribute();
      case KM3Package.TYPE_REF: return createTypeRef();
      case KM3Package.REFERENCE: return createReference();
      case KM3Package.MULTIPLICITY: return createMultiplicity();
      case KM3Package.DATATYPE: return createDatatype();
      case KM3Package.ENUMERATION: return createEnumeration();
      case KM3Package.LITERAL: return createLiteral();
      default:
        throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Metamodel createMetamodel()
  {
    MetamodelImpl metamodel = new MetamodelImpl();
    return metamodel;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public org.dslintegration.kM3.Package createPackage()
  {
    PackageImpl package_ = new PackageImpl();
    return package_;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Classifier createClassifier()
  {
    ClassifierImpl classifier = new ClassifierImpl();
    return classifier;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public KM3Class createKM3Class()
  {
    KM3ClassImpl km3Class = new KM3ClassImpl();
    return km3Class;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Feature createFeature()
  {
    FeatureImpl feature = new FeatureImpl();
    return feature;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Attribute createAttribute()
  {
    AttributeImpl attribute = new AttributeImpl();
    return attribute;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public TypeRef createTypeRef()
  {
    TypeRefImpl typeRef = new TypeRefImpl();
    return typeRef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Reference createReference()
  {
    ReferenceImpl reference = new ReferenceImpl();
    return reference;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Multiplicity createMultiplicity()
  {
    MultiplicityImpl multiplicity = new MultiplicityImpl();
    return multiplicity;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Datatype createDatatype()
  {
    DatatypeImpl datatype = new DatatypeImpl();
    return datatype;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Enumeration createEnumeration()
  {
    EnumerationImpl enumeration = new EnumerationImpl();
    return enumeration;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Literal createLiteral()
  {
    LiteralImpl literal = new LiteralImpl();
    return literal;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public KM3Package getKM3Package()
  {
    return (KM3Package)getEPackage();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @deprecated
   * @generated
   */
  @Deprecated
  public static KM3Package getPackage()
  {
    return KM3Package.eINSTANCE;
  }

} //KM3FactoryImpl
